<include file="Public/siteTopbar" />
<script src="__PUBLIC__/js/jquery-1.8.2.min.js"></script>
<script src="__PUBLIC__/js/global.js"></script>
<script src="__PUBLIC__/js/pc_common.js"></script>
<script src="__PUBLIC__/js/layer/layer.js"></script>
<include file="Public/header" />

<div class="container usercenter" style="padding-bottom:10px;">
    <div class="page-title">
        <h1>Order submitted successfully, please pay as soon as possible!</h1>
    </div>
  <p>Order #:&nbsp;&nbsp;{$order['order_sn']}<br  />
               	Order Total:&nbsp;&nbsp;<b>{$order[currency]|get_money_str}{$order['order_amount']}</b></p>
                
                 <p>Click <a id="href" href="{:U('Home/User/order_detail',array('id'=>$order['order_id']))}" style=" color:#CC0066;">here</a> to View order details.</p>
</div>



        <!--<form action="{:U('Home/Payment/getCode')}" method="post" name="cart4_form" id="cart4_form">-->
        <form  method="post" name="cart4_form" id="cart4_form">
            <div class="container usercenter">
                <div class="page-title">
                    <h1>Payment method</h1>
                </div>
            <div>
             <!--<foreach name="paymentList" item="v"  key="k">-->
                 <!--<p><input type="radio" id="input-ALIPAY-1" value="{$v['code']}" class="radio vam" name="pay_radio" > Paypal and Credit card</p>-->
                <!---->
             <!--</foreach>-->
                <!--<p><input type="radio" id="input-ALIPAY-1" value="{$v['code']}" class="radio vam" name="pay_radio" > Paypal and Credit card</p>-->

                <!--<p><input type="radio" id="" value="dhpay" class="radio vam" name="pay_radio" >Dhpay and Credit card</p>-->



                 </div>
                <div class="clear" style="margin-bottom:20px;"></div>
               <!--<a class="button-style-5 button-confirm-payment" href="javascript:void(0);" onClick="$('#cart4_form').submit();" style="color:#fff; text-align:center; background:#CC0066; padding:10px 20px; border-radius:5px; overflow:hidden; " >CONTINUE TO PAYMENT</a>-->
                <!--<a  class="button-style-5 button-confirm-payment" href="javascript:void(0);"   onclick="get_pay_type({$order[order_id]});" style="color:#fff; text-align:center; background:#CC0066; padding:10px 20px; border-radius:5px; overflow:hidden; "  >CONTINUE TO PAYMENT</a>-->

                <a class="button-style-5 button-confirm-payment" href="{:U('Home/Cart/getCode',array('order_id'=>$order['order_id']))}"   target="_blank" style="color:#fff; text-align:center; background:#CC0066; padding:10px 20px; border-radius:5px; overflow:hidden; " >CONTINUE TO PAYMENT</a>
               <!--<a class="button-style-5 button-confirm-payment" href="javascript:void(0);"   onclick="get_pay_type();" style="color:#fff; text-align:center; background:#CC0066; padding:10px 20px; border-radius:5px; overflow:hidden; " >CONTINUE TO PAYMENT</a>-->
               <!--<a class="button-style-5 button-confirm-payment" href="{:U('User/level',array('act'=>'edit','level_id'=>$vo['level_id']))}" id="pay_link"  target="_blank" style="color:#fff; text-align:center; background:#CC0066; padding:10px 20px; border-radius:5px; overflow:hidden; " >CONTINUE TO PAYMENT</a>-->
                <!--&lt;!&ndash; PayPal Logo &ndash;&gt;-->
                <!--<table border="0" cellpadding="10" cellspacing="0" align="center">-->
                    <!--<tr>-->
                        <!--<td align="center"></td>-->
                    <!--</tr>-->
                    <!--<tr>-->
                        <!--<td align="center"><a href="https://www.paypal.com/c2/webapps/mpp/paypal-popup?locale.x=zh_C2" title="How PayPal Works" onclick="javascript:window.open('https://www.paypal.com/c2/webapps/mpp/paypal-popup?locale.x=zh_C2','WIPaypal','toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=yes, resizable=yes, width=1060, height=700'); return false;">-->
                            <!--<img src="https://www.paypalobjects.com/webstatic/en_US/i/buttons/PP_logo_h_100x26.png" alt="立即使用PayPal购买" /></a>-->
                        <!--</td>-->
                    <!--</tr>-->
                <!--</table>-->
                <!--&lt;!&ndash; PayPal Logo &ndash;&gt;-->

                <input type="hidden" name="order_id" value="{$order['order_id']}" />
            </div>
        </form>


<form action="https://www.dhpay.com/merchant/web/cashier" method="post" id="dhpay_form" target="_blank">

    <input type="hidden" name="merchant_id" value="{$data['merchant_id']}" class="dhpay-radio" />
    <input type="hidden" name="invoice_id" value="{$data['invoice_id']}" class="dhpay-radio" />
    <input type="hidden" name="order_no" value="{$data['order_no']}" class="dhpay-radio" />
    <input type="hidden" name="currency" value="{$data['currency']}" class="dhpay-radio" />
    <input type="hidden" name="amount" value="{$data['amount']}" class="dhpay-radio" />
    <input type="hidden" name="buyer_email" value="{$data['buyer_email']}" class="dhpay-radio" />
    <input type="hidden" name="return_url" value="{$data['return_url']}" class="dhpay-radio" />
    <input type="hidden" name="remark" value="{$data['remark']}" class="dhpay-radio" />
    <input type="hidden" name="shipping_country" value="{$data['shipping_country']}" class="dhpay-radio" />
    <input type="hidden" name="first_name" value="{$data['first_name']}" class="dhpay-radio" />
    <input type="hidden" name="last_name" value="{$data['last_name']}" class="dhpay-radio" />
    <input type="hidden" name="product_name" value="{$data['product_name']}" class="dhpay-radio" />
    <input type="hidden" name="product_price" value="{$data['product_price']}" class="dhpay-radio" />
    <input type="hidden" name="product_quantity" value="{$data['product_quantity']}" class="dhpay-radio" />
    <input type="hidden" name="address_line" value="{$data['address_line']}" class="dhpay-radio" />
    <input type="hidden" name="city" value="{$data['city']}" class="dhpay-radio" />
    <input type="hidden" name="country" value="{$data['country']}" class="dhpay-radio" />
    <input type="hidden" name="state" value="{$data['state']}" class="dhpay-radio" />
    <input type="hidden" name="zipcode" value="{$data['zipcode']}" class="dhpay-radio" />
    <input type="hidden" name="hash" value="{$hash}" class="dhpay-radio" />


</form>


<include file="Public/footer" />
</body>
</html>


<link rel="stylesheet" href="__STATIC__/css/cart.css" type="text/css">
   
<script>


    function get_pay_type(order_id){
        var pay_type = $("input[name='pay_radio']:checked").val();
        if(pay_type=='dhpay'){
            $('#dhpay_form').submit();
//            var url= '/index.php/Home/Cart/dhpay/order_id/'+order_id;
        }else{
             var url= '/index.php/Home/Cart/getCode/order_id/'+order_id;
            window.open(url);
        }

    }
//$(document).ready(function(){
//	 $("input[name='pay_radio']").first().trigger('click');
//
//    $.ajax({
//        type : "POST",
//        url:"{:U('Home/Cart/getCode')}",//+tab,
//        data : $('#cart4_form').serialize(),// 你的formid
//        dataType:"json",
//        success: function(data){
//            alert(data);
//            $('#pay_link').attr('href',data);
//
//        }
//    });
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//});

function change_pay(obj)
{
	$(obj).parent().siblings('input[name="pay_radio"]').trigger('click');
}
</script>    

